package cn.finder.httpcommons;

import java.util.Date;
import java.util.Map;

import cn.finder.httpcommons.request.BaseRequest;
import cn.finder.httpcommons.response.ApiResponse;
import cn.finder.httpcommons.utils.FileItem;

public interface IClient {

	 // Methods
    /// <summary>
    /// 发送客户端请求
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="request"></param>
    /// <returns></returns>

    <T extends ApiResponse>  T execute(BaseRequest<T> request);

    /// <summary>
    /// 发送客户端请求
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="request"></param>
    /// <param name="session"></param>
    /// <returns></returns>
    //T Execute<T>(BaseRequest<T> request, string session) where T : ApiResponse;

    <T extends ApiResponse>  T execute(BaseRequest<T> request, String session);
    
    /// <summary>
    /// 发送请求，并返回Response对象 
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="request"></param>
    /// <param name="session"></param>
    /// <param name="timestamp"></param>
    /// <returns></returns>
   // T Execute<T>(BaseRequest<T> request, string session, DateTime timestamp) where T : ApiResponse;

    <T extends ApiResponse>   T execute(BaseRequest<T> request, String session, Date timestamp);

    //// Methods
    //ApiResponse<T> Execute<T>(BaseRequest<ApiResponse<T>> request) where T : ApiObject;
    //ApiResponse<T> Execute<T>(BaseRequest<ApiResponse<T>> request, string session) where T : ApiObject;

    ///// <summary>
    ///// 发送请求，并返回Response对象 
    ///// </summary>
    ///// <typeparam name="T"></typeparam>
    ///// <param name="request"></param>
    ///// <param name="session"></param>
    ///// <param name="timestamp"></param>
    ///// <returns></returns>
    //ApiResponse<T> Execute<T>(BaseRequest<ApiResponse<T>> request, string session, DateTime timestamp) where T : ApiObject;





    //void ExecuteInThread<T>(BaseRequest<T> request) where T : ApiResponse;

    //纯文本数据请求
   // string Execute(ApiDictionary parameters, string session, DateTime timestamp,string method);
    
    String execute(ApiDictionary parameters, String session, Date timestamp,String method);

    //带有文件数据
    //string Execute(ApiDictionary parameters, IDictionary<string,FileItem> fileParams, string session, DateTime timestamp, string method);
    
    String execute(ApiDictionary parameters, Map<String,FileItem> fileParams, String session, Date timestamp, String method);


    //纯文本数据请求构建请求字符串
    //string BuildReqGetUrlString(ApiDictionary parameters, string session, DateTime timestamp, string method);
    
    String buildReqGetUrlString(ApiDictionary parameters, String session, Date timestamp, String method);


    /// <summary>
    /// 上传文件测试
    /// </summary>
    /// <param name="parameters"></param>
    /// <param name="session"></param>
    /// <param name="timestamp"></param>
    /// <param name="method"></param>
    /// <returns></returns>
    //string ExecuteFileStream(ApiDictionary parameters, string session, DateTime timestamp, string method);
    String executeFileStream(ApiDictionary parameters, String session, Date timestamp, String method);
}
